<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>/data/HEFR/1/tech_num/iTimer_Projekt/testbench/buttonHandler_tb.vhdl.html</title>
<meta name="Generator" content="Vim/7.2">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
</head>
<body bgcolor="#ffffff" text="#000000"><font face="monospace">
<font color="#00008b">---------------------------------------------------------------------------</font><br>
<font color="#00008b">-- Company&nbsp;&nbsp;&nbsp;&nbsp; : EIA / HTA </font><br>
<font color="#00008b">-- Author&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;: Yves Peissard &lt;ypeissard@gmail.com&gt;</font><br>
<font color="#00008b">-- </font><br>
<font color="#00008b">-- Creation Date : 23/04/2009</font><br>
<font color="#00008b">-- File&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;: buttonHandler.vhdl</font><br>
<font color="#00008b">--</font><br>
<font color="#00008b">-- Abstract : This is the testbench file for the buttonHandler block</font><br>
<font color="#00008b">--&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;of the iTimer project.</font><br>
<font color="#00008b">--&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><br>
<font color="#00008b">-- </font><br>
<font color="#00008b">---------------------------------------------------------------------------</font><br>
<br>
<font color="#a52a2a"><b>library</b></font>&nbsp;IEEE<font color="#6a5acd">;</font><br>
<font color="#a52a2a"><b>use</b></font>&nbsp;IEEE<font color="#6a5acd">.</font>std_logic_1164<font color="#6a5acd">.</font><font color="#a52a2a"><b>all</b></font><font color="#6a5acd">;</font><br>
<br>
<font color="#a52a2a"><b>entity</b></font>&nbsp;buttonHandler_tb <font color="#a52a2a"><b>is</b></font><br>
<font color="#a52a2a"><b>end</b></font>&nbsp;buttonHandler_tb<font color="#6a5acd">;</font><br>
<br>
<font color="#a52a2a"><b>architecture</b></font>&nbsp;testbench1 <font color="#a52a2a"><b>of</b></font>&nbsp;buttonHandler_tb <font color="#a52a2a"><b>is</b></font><br>
<br>
&nbsp;&nbsp;<font color="#00008b">-- component decleration</font><br>
<br>
<font color="#a52a2a"><b>component</b></font>&nbsp;buttonHandler<br>
&nbsp;&nbsp;&nbsp;&nbsp;<font color="#a52a2a"><b>port</b></font>&nbsp;<font color="#6a5acd">(</font><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;buttonInput<font color="#6a5acd">,</font>clockInput <font color="#2e8b57"><b>:</b></font>&nbsp;<font color="#a52a2a"><b>in</b></font>&nbsp;<font color="#2e8b57"><b>std_logic</b></font><font color="#6a5acd">;</font>&nbsp;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;simplePush<font color="#6a5acd">,</font>longPush <font color="#2e8b57"><b>:</b></font>&nbsp;<font color="#a52a2a"><b>out</b></font>&nbsp;<font color="#2e8b57"><b>std_logic</b></font><br>
&nbsp;&nbsp;&nbsp;&nbsp;<font color="#6a5acd">);</font><br>
<font color="#a52a2a"><b>end</b></font>&nbsp;<font color="#a52a2a"><b>component</b></font><font color="#6a5acd">;</font><br>
&nbsp;&nbsp;&nbsp;&nbsp;<br>
<br>
&nbsp;&nbsp;<font color="#00008b">-- configuration</font><br>
&nbsp;&nbsp;<font color="#a52a2a"><b>for</b></font>&nbsp;i_buttonHandler <font color="#2e8b57"><b>:</b></font>&nbsp;buttonHandler <font color="#a52a2a"><b>use</b></font>&nbsp;<font color="#a52a2a"><b>entity</b></font>&nbsp;WORK<font color="#6a5acd">.</font>buttonHandler<font color="#6a5acd">(</font>buttonHandler_arch<font color="#6a5acd">);</font><br>
<br>
&nbsp;&nbsp;<font color="#00008b">-- internal signals</font><br>
&nbsp;&nbsp;<font color="#a52a2a"><b>signal</b></font>&nbsp;buttonInput<font color="#6a5acd">,</font>simplePush<font color="#6a5acd">,</font>longPush<font color="#6a5acd">,</font>&nbsp;clockInput <font color="#2e8b57"><b>:</b></font>&nbsp;<font color="#2e8b57"><b>std_logic</b></font>&nbsp;<font color="#2e8b57"><b>:=</b></font>&nbsp;<font color="#ff00ff">'0'</font><font color="#6a5acd">;</font><br>
&nbsp;&nbsp;<font color="#a52a2a"><b>constant</b></font>&nbsp;period <font color="#2e8b57"><b>:</b></font>&nbsp;<font color="#2e8b57"><b>time</b></font>&nbsp;<font color="#2e8b57"><b>:=</b></font>&nbsp;<font color="#ff00ff">50 ns</font><font color="#6a5acd">;</font><br>
<br>
&nbsp;&nbsp;<font color="#a52a2a"><b>begin</b></font>&nbsp;<font color="#00008b">--architecture</font><br>
<br>
&nbsp;&nbsp; <br>
&nbsp;&nbsp;&nbsp;&nbsp;i_buttonHandler <font color="#2e8b57"><b>:</b></font>&nbsp;buttonHandler<br>
&nbsp;&nbsp;&nbsp;&nbsp;<font color="#a52a2a"><b>port</b></font>&nbsp;<font color="#a52a2a"><b>map</b></font>&nbsp;<font color="#6a5acd">(</font><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;buttonInput <font color="#2e8b57"><b>=&gt;</b></font>&nbsp;buttonInput<font color="#6a5acd">,</font><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;clockInput&nbsp;&nbsp;<font color="#2e8b57"><b>=&gt;</b></font>&nbsp;clockInput<font color="#6a5acd">,</font><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;simplePush&nbsp;&nbsp;<font color="#2e8b57"><b>=&gt;</b></font>&nbsp;simplePush<font color="#6a5acd">,</font><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;longPush&nbsp;&nbsp;&nbsp;&nbsp;<font color="#2e8b57"><b>=&gt;</b></font>&nbsp;longPush<br>
&nbsp;&nbsp;&nbsp;&nbsp;<font color="#6a5acd">);</font><br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;generate_clock <font color="#2e8b57"><b>:</b></font>&nbsp;<font color="#a52a2a"><b>process</b></font>&nbsp;<font color="#6a5acd">(</font>clockInput<font color="#6a5acd">)</font><br>
&nbsp;&nbsp;&nbsp;&nbsp;<font color="#a52a2a"><b>begin</b></font>&nbsp;<font color="#00008b">-- process</font><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;clockInput <font color="#2e8b57"><b>&lt;=</b></font>&nbsp;<font color="#2e8b57"><b>NOT</b></font>&nbsp;clockInput <font color="#a52a2a"><b>after</b></font>&nbsp;period<font color="#2e8b57"><b>/</b></font><font color="#ff00ff">2</font><font color="#6a5acd">;</font><br>
&nbsp;&nbsp;&nbsp;&nbsp;<font color="#a52a2a"><b>end</b></font>&nbsp;<font color="#a52a2a"><b>process</b></font><font color="#6a5acd">;</font><br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;<font color="#a52a2a"><b>process</b></font>&nbsp;<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;<font color="#a52a2a"><b>begin</b></font><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="#a52a2a"><b>wait</b></font>&nbsp;<font color="#a52a2a"><b>for</b></font>&nbsp;<font color="#ff00ff">2</font><font color="#2e8b57"><b>*</b></font>period <font color="#2e8b57"><b>+</b></font>&nbsp;<font color="#ff00ff">66 ns</font><font color="#6a5acd">;</font><br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="#00008b">-- simple push case</font><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;buttonInput <font color="#2e8b57"><b>&lt;=</b></font>&nbsp;<font color="#ff00ff">'1'</font><font color="#6a5acd">;</font><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="#a52a2a"><b>wait</b></font>&nbsp;<font color="#a52a2a"><b>for</b></font>&nbsp;period<font color="#6a5acd">;</font><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;buttonInput <font color="#2e8b57"><b>&lt;=</b></font>&nbsp;<font color="#ff00ff">'0'</font><font color="#6a5acd">;</font>&nbsp;&nbsp; <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="#a52a2a"><b>wait</b></font>&nbsp;<font color="#a52a2a"><b>for</b></font>&nbsp;period<font color="#6a5acd">;</font><br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="#00008b">-- long push case</font><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;buttonInput <font color="#2e8b57"><b>&lt;=</b></font>&nbsp;<font color="#ff00ff">'1'</font><font color="#6a5acd">;</font><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="#a52a2a"><b>wait</b></font>&nbsp;<font color="#a52a2a"><b>for</b></font>&nbsp;<font color="#ff00ff">15 ms</font><font color="#6a5acd">;</font><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;buttonInput <font color="#2e8b57"><b>&lt;=</b></font>&nbsp;<font color="#ff00ff">'0'</font><font color="#6a5acd">;</font><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="#a52a2a"><b>wait</b></font>&nbsp;<font color="#a52a2a"><b>for</b></font>&nbsp;period<font color="#6a5acd">;</font><br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="#00008b">-- long push case</font><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;buttonInput <font color="#2e8b57"><b>&lt;=</b></font>&nbsp;<font color="#ff00ff">'1'</font><font color="#6a5acd">;</font><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="#a52a2a"><b>wait</b></font>&nbsp;<font color="#a52a2a"><b>for</b></font>&nbsp;<font color="#ff00ff">15 ms</font><font color="#6a5acd">;</font><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;buttonInput <font color="#2e8b57"><b>&lt;=</b></font>&nbsp;<font color="#ff00ff">'0'</font><font color="#6a5acd">;</font><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="#a52a2a"><b>wait</b></font>&nbsp;<font color="#a52a2a"><b>for</b></font>&nbsp;period<font color="#6a5acd">;</font><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="#00008b">-- simple push case</font><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;buttonInput <font color="#2e8b57"><b>&lt;=</b></font>&nbsp;<font color="#ff00ff">'1'</font><font color="#6a5acd">;</font><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="#a52a2a"><b>wait</b></font>&nbsp;<font color="#a52a2a"><b>for</b></font>&nbsp;period<font color="#6a5acd">;</font><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;buttonInput <font color="#2e8b57"><b>&lt;=</b></font>&nbsp;<font color="#ff00ff">'0'</font><font color="#6a5acd">;</font><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="#a52a2a"><b>wait</b></font>&nbsp;<font color="#a52a2a"><b>for</b></font>&nbsp;period<font color="#6a5acd">;</font><br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="#00008b">-- simple push case</font><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;buttonInput <font color="#2e8b57"><b>&lt;=</b></font>&nbsp;<font color="#ff00ff">'1'</font><font color="#6a5acd">;</font><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="#a52a2a"><b>wait</b></font>&nbsp;<font color="#a52a2a"><b>for</b></font>&nbsp;period<font color="#6a5acd">;</font><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;buttonInput <font color="#2e8b57"><b>&lt;=</b></font>&nbsp;<font color="#ff00ff">'0'</font><font color="#6a5acd">;</font><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="#a52a2a"><b>wait</b></font>&nbsp;<font color="#a52a2a"><b>for</b></font>&nbsp;period<font color="#6a5acd">;</font><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <font color="#a52a2a"><b>assert</b></font>&nbsp;<font color="#ff00ff">false</font>&nbsp;<font color="#a52a2a"><b>report</b></font>&nbsp;<font color="#ff00ff">&quot;simulation finished&quot;</font>&nbsp;<font color="#a52a2a"><b>severity</b></font>&nbsp;<font color="#a52a2a"><b>note</b></font><font color="#6a5acd">;</font><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <font color="#a52a2a"><b>wait</b></font><font color="#6a5acd">;</font><br>
&nbsp;&nbsp;&nbsp;&nbsp;<font color="#a52a2a"><b>end</b></font>&nbsp;<font color="#a52a2a"><b>process</b></font><font color="#6a5acd">;</font>&nbsp;&nbsp; <br>
<font color="#a52a2a"><b>end</b></font>&nbsp;<font color="#a52a2a"><b>architecture</b></font><font color="#6a5acd">;</font><br>
</font></body>
</html>
